package pl.basesoft.domain;

import javax.persistence.Embeddable;

@Embeddable
public class Credential {
	private String login;
	private String password;
	
	
	public Credential(String login, String password) {
		this.login = login;
		this.password = password;
	}
	
	
	public boolean equals(Credential credential) {
		return isLoginCorrect(credential) && isPasswordCorrect(credential);
	}
	
	public boolean isLoginCorrect(Credential credential){
		return login.equals(credential.login);
	}
	
	public boolean isPasswordCorrect(Credential credential) {
		return password.equals(credential.password);
	}
}
